<template>
  <div class="detail-info">
    <div class="name">{{topInfos.houseName}}</div>
    <div class="tags">
      <template v-for="(item, index) of topInfos.houseTags">
        <span 
          class="item" 
          v-if="item.tagText"
          :style="{color:item.tagText.color, background: item.tagText.background.color}">
          {{item.tagText.text}}
        </span>
      </template>
    </div>
    <div class="comment">
      <div class="left">
        <span class="score">{{topInfos.commentBrief?.overall}}</span>
        <span class="title">{{topInfos.commentBrief?.scoreTitle}}</span>
        <span class="brief">"{{topInfos.commentBrief?.commentBrief}}"</span>
      </div>
      <div class="right">
        <span class="count">
          {{topInfos.commentBrief?.totalCount}}条评论
          <van-icon name="arrow"></van-icon>
        </span>
      </div>
    </div>
    <div class="location">
      <div class="left">{{topInfos.nearByPosition?.address}}</div>
      <div class="right">地图·周边</div>
    </div>
  </div>
</template>

<script setup>
import {  } from 'vue'
defineProps({
  topInfos:{
    type:Object,
    default: () => ({})
  }
})

</script>

<style lang='less' scoped>
.detail-info{
  padding: 10px;
}
.name{
  font-weight: 600;
  font-size: 18px;
}
.tags{
  padding: 5px 0;
  .item{
    margin: 5px;
    padding: 2px;
    display: inline-block;
  }
}
.comment{
  display: flex;
  justify-content: space-between;
  background-color: var(--light-color);
  align-items: center;
  padding: 5px 0;
  margin-bottom: 10px;
  .left{
    .score{
      font-weight: 600;
      font-size: 18px;
    }
    .title{
      &:extend(.score);
    }
  }
  .right{
    color: var(--primary-color);
  }
}
.location{
  &:extend(.comment);
  .left{
    font-weight: 600;
    font-size: 16px;
  }
  .right{
    color: var(--primary-color);
  }
}
</style>